import { pget, ppostJson } from '@/utils/req';
import { modalApi } from '@/utils/modalReq';
/**
 * 列表数据
 * @param query
 * @returns
 */
export async function getList(params: any): Promise<any> {
  return pget(`${modalApi.order}/shopec-order-car/ordercar/page`, params);
}
/**
 * 减免订单列表数据
 * @param query
 * @returns
 */
export async function getOrderReductionList(params: any): Promise<any> {
  return pget(`${modalApi.finance}/shopec-order-abatement/orderabatement/page`, params);
}
/**
 * 还款明细列表数据
 * @param query
 * @returns
 */
export async function getRepaymentDetailsList(params: any): Promise<any> {
  return pget(`${modalApi.finance}/shopec-order-receivable/orderreceivable/orderReceivableList`,params);
}
/**
 *
 * @param id 订单 详情
 * @returns
 */
export async function getOrderDetails(id: string): Promise<any> {
  return pget(`${modalApi.order}/shopec-order-car/ordercar/detail/${id}`);
}
/**
 * 新增订单
 * @param params
 * @returns
 */
export async function addOrder(params: any): Promise<any> {
  return ppostJson(`${modalApi.order}/shopec-order-car/ordercar/save`, params);
}
/**
 * 取消订单
 * @param params
 * @returns
 */
export async function cancelOrder(params: any): Promise<any> {
  return ppostJson(
    `${modalApi.order}/shopec-order-car/ordercar/cancel?ids=${params}`,
  );
}
/**
 * 删除订单
 * @param params
 * @returns
 */
export async function deleteOrder(params: any): Promise<any> {
  return ppostJson(
    `${modalApi.order}/shopec-order-car/ordercar/remove?ids=${params?.ids}`,
  );
}
/**
 * 绑车
 * @param id 订单ID
 * @param params 车辆信息
 * @returns
 */
export async function orderBindCar(id: string, params: any): Promise<any> {
  return ppostJson(
    `${modalApi.order}/shopec-order-car/ordercar/tiedCar/${id}`,
    params,
  );
}
/**
 * 订单验车
 * @param id
 * @param params
 * @returns
 */
export async function orderValidateCar(id: string, params: any): Promise<any> {
  return ppostJson(
    `${modalApi.order}/shopec-order-validate/ordervalidate/validateCar/${id}`,
    params,
  );
}
/**
 * 订单签约
 * @param id
 * @param params
 * @returns
 */
export async function orderSigned(id: string, params: any): Promise<any> {
  return ppostJson(
    `${modalApi.order}/shopec-order-contract/ordercontract/signed/${id}`,
    params,
  );
}
/**
 * 交车
 * @param id
 * @param params
 * @returns
 */
export async function orderDeliveryCar(id: string, params: any): Promise<any> {
  return ppostJson(
    `${modalApi.order}/shopec-order-delivery/orderdelivery/deliveryCar/${id}`,
    params,
  );
}
/**
 * 订单续租
 * @param params
 * @returns
 */
export async function orderRelet(params: any): Promise<any> {
  return ppostJson(
    `${modalApi.order}/shopec-order-relet/orderrelet/orderRelet`,
    params,
  );
}
/**
 * 换车
 * @param params
 * @returns
 */
export async function orderChangeCar(params: any): Promise<any> {
  return ppostJson(
    `${modalApi.order}/shopec-order-change/orderchange/orderChange`,
    params,
  );
}
/**
 * 退车
 * @param params
 * @returns
 */
export async function returnCar(params: any): Promise<any> {
  return ppostJson(
    `${modalApi.order}/shopec-order-return/orderreturn/orderReturn`,
    params,
  );
}
/**
 * 商品方案列表
 * @param params
 * @returns
 */
export async function commodityProgrammes(params: any): Promise<any> {
  return ppostJson(
    `${modalApi.marketing}/shopec-marketing/commodity-scheme/listByParams`,
    params,
  );
}
/**
 * 申请费用减免
 * @param params
 * @returns
 */
export async function feeReduction(params: any): Promise<any> {
  return ppostJson(
    `${modalApi.order}/shopec-order-car/ordercar/applyAbatement`,
    params,
  );
}

/**
 * 续租记录
 * @param query
 * @returns
 */
export async function getRenewalRecord(params: any): Promise<any> {
  return pget(`${modalApi.order}/shopec-order-relet/orderrelet/page`, params);
}
/**
 * 换车历史记录
 * @param query
 * @returns
 */
export async function getCarHistory(params: any): Promise<any> {
  return pget(`${modalApi.order}/shopec-order-change/orderchange/historyPage`, params);
}
/**
 *
 * @param id 换车退车详情 
 * @returns
 */
export async function getReturnDetails(id: string): Promise<any> {
  return pget(`${modalApi.order}/shopec-order-return/orderreturn/detail/${id}`);
}
/**
 * 退车验车
 * @param params
 * @returns
 */
export async function vehicleReturnInspection(params: any): Promise<any> {
  return ppostJson(
    `${modalApi.order}/shopec-order-return/orderreturn/orderReturnValidate`,
    params,
  );
}
/**
 * 退车收费
 * @param params
 * @returns
 */
export async function vehicleReturnInspectionCharge(params: any): Promise<any> {
  return ppostJson(
    `${modalApi.order}/shopec-order-return/orderreturn/orderReturnSettlement`,
    params,
  );
}
/**
 *
 * @param id 欠租金额 
 * @returns
 */
export async function orderArrearsSum(params: any): Promise<any> {
  return pget(`${modalApi.finance}/shopec-order-receivable/orderreceivable/orderArrearsSum`, params);
}
/**
 *
 * @param id 减免剩余金额 
 * @returns
 */
export async function residualAbatementList(params: any): Promise<any> {
  return pget(`${modalApi.finance}/shopec-order-abatement/orderabatement/residualAbatementList`, params);
}
/**
 * 申请过户
 * @param id
 * @param params
 * @returns
 */
export async function postTransfer(id: string, params: any): Promise<any> {
  return ppostJson(
    `${modalApi.order}/shopec-order-transfer/ordertransfer/transferCar/${id}`,
    params,
  );
}
/**
 * 申请过户信息详情
 * @param id
 * @param params
 * @returns
 */
export async function getTransfer(id: string): Promise<any> {
  return pget(
    `${modalApi.order}/shopec-order-transfer/ordertransfer/detail/${id}`
  );
}
/**
 * 用户资料上传
 * @param id
 * @param params
 * @returns
 */
export async function postUserInfo(id: string, params: any): Promise<any> {
  return ppostJson(
    `${modalApi.order}/shopec-order-transfer/ordertransfer/furtherInformation/${id}`,
    params,
  );
}
/**
 * 订单操作记录
 * @param id 减免剩余金额 
 * @returns
 */
export async function getOperationRecord(params: any): Promise<any> {
  return pget(`${modalApi.order}/shopec-order-log/orderlog/page`, params);
}
/**
 * 换车详情查询
 * @param id 
 * @returns
 */
export async function getTransferDetails(id: any): Promise<any> {
  return pget(`${modalApi.order}/shopec-order-change/orderchange/detail/${id}`);
}
/**
 * 修改非滴滴司机ID
 * @param id
 * @param params
 * @returns
 */
export async function editDDId( id:any,did: any): Promise<any> {
  return ppostJson(
    `${modalApi.order}/shopec-order-car/ordercar/updateDriverId/${id}/${did}`,
  );
}
/**
 * 换车费用结算
 * @param id
 * @param params
 * @returns
 */
export async function ChangeFare( params: any): Promise<any> {
  return ppostJson(
    `${modalApi.order}/shopec-order-change/orderchange/orderChangeSettlement`,
    params,
  );
}

// 非滴滴司机导入
export async function getImportDDlist(params:any): Promise<any> {
  return ppostJson(`${modalApi.order}/shopec-order-car/ordercar/importPlatformId/${params?.batch}`);
}
// 非滴滴司机导入文件
export const postImportDDlist = `${modalApi.order}/shopec-order-car/ordercar/importPlatformId/view`


// 免租导入
export async function getRentFree(params: any): Promise<any> {
  return ppostJson(`${modalApi.order}/shopec-order-car/ordercar/importExemption/${params?.batch}`);
}
// 免租导入文件
export const postRentFree = `${modalApi.order}/shopec-order-car/ordercar/importExemption/view`


// 延租导入
export async function getExtendedLease(params: any): Promise<any> {
  return ppostJson(`${modalApi.order}/shopec-order-car/ordercar/importDelay/${params?.batch}`);
}
// 延租导入文件
export const postExtendedLease = `${modalApi.order}/shopec-order-car/ordercar/importDelay/view`


// 退车费用项导入
export async function getIReturnCar(params: any): Promise<any> {
  return ppostJson(`${modalApi.order}/shopec-order-return/orderreturn/importSettlement/${params?.batch}`);
}
// 退车费用项导入文件
export const postIReturnCar = `${modalApi.order}/shopec-order-return/orderreturn/importSettlement/view`


// 换车费用项导入
export async function getChangeCar(params: any): Promise<any> {
  return ppostJson(`${modalApi.order}/shopec-order-change/orderchange/importSettlement/${params?.batch}`);
}
// 换车费用项导入文件
export const postIChangeCar = `${modalApi.order}/shopec-order-change/orderchange/importSettlement/view`


// 过户费用项导入
export async function getTransferCar(params: any): Promise<any> {
  return ppostJson(`${modalApi.order}/shopec-order-transfer/ordertransfer/importSettlement/${params?.batch}`);
}
// 过户费用项导入文件
export const postITransferCar = `${modalApi.order}/shopec-order-transfer/ordertransfer/importSettlement/view`


// 获取导入数据列表
export async function getData(params: any): Promise<any> {
  return pget(`${modalApi.order}/assetsaccidentdataprocessing/page`, params);
}